<template>
  <div :class="['new-form-box', show == true ? 'md-show' : '']">
    <div class="title-box">
      <div>
        {{ titleName }}
      </div>
      <span @click="show = false">X</span>
    </div>
    <div class="content-box">
      <slot></slot>
    </div>
    <div class="footer-box">
      <a-button style="margin-right: 10px" type="primary" @click="send"
        >确认</a-button
      >
      <a-button @click="Reset"> 取消</a-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: {
    titleName: {
      type: String,
      default: "啥大事的",
    },
    show: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style lang="less" scoped>
.new-form-box {
  position: absolute;
  box-sizing: border-box;
  width: 100%;
  background-color: #fff;
  z-index: 99;
  border: 1px solid #e7eaec;
  display: none;

  .title-box {
    padding-left: 20px;
    background: #f8f8f8;
    color: #333;
    font-size: 14px;
    height: 42px;
    line-height: 42px;
    border: none;
    font-weight: bold;
    border-bottom: 1px solid #e7eaec;
    display: flex;
    align-items: center;
    justify-content: space-between;
    span {
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 42px;
      height: 42px;
    }
    span:hover {
      background-color: rgb(221, 221, 221);
    }
  }
  .content-box {
    height: calc(100% - 42px);
    overflow: auto;
    padding: 20px 40px;
  }
  .footer-box {
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 56px;
    background: #f8f8f8;
    border-top: 1px solid rgb(233, 233, 233);
  }
}
.md-show {
  display: block;
}
</style>